<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //5.解构赋值
        var a = 12;
        var b = 13;
        var c = 14;
        alert(a);

        var [a,b,c] = [12,13,14];
        console.log(a,b,c);

        // 与json来配合（与顺序无关的）
        var {a,b,c}  = {b:13,a:12,c:14};
        console.log(a,b,c);

        //模式匹配：左边的结构与右边的结构是一样的
        var [a,[b,c],d] = [12,[1,2],5];
        console.log(a,b,c,d);

        //交互-对数据的解析
        var arr = [{title:'test',href:'www.163.com',img:'img1'}];
        var [{title,href,img}] = arr;
        console.log(title,href,img);

     
    </script>
</head>
<body>

</body>
</html>